@extends('admin.layout.base')
@section('styles')
    <style>
        .el-icon-plus{
            cursor: pointer;
            font-size: 28px;
            color: #8c939d;
            border: 1px dashed #d9d9d9;
            border-radius: 6px;
            text-align: center;
        }
        .img-uploader{
            border: 1px dashed #d9d9d9;
            display: block;
        }
        .site_logo-img,.site_logo-uploader-icon{
            width: 200px;
            height: 80px;
            line-height: 80px;
        }
        /*.wap_logo-img,.wap_logo-uploader-icon{*/
            /*width: 100px;*/
            /*height: 50px;*/
            /*line-height: 50px;*/
        /*}*/
        .public_code-img,.public_code-uploader-icon {
            width: 180px;
            height: 180px;
            line-height: 50px;
        }
        .default_avatar-img,.default_avatar-uploader-icon{
            width: 80px;
            height: 80px;
            line-height: 80px;
            border-radius: 50%;
        }
        .login_logo-img,.login_logo-uploader-icon {
            width: 450px;
            height: 300px;
            line-height: 50px;
        }
    </style>
@endsection
@section('content')
    <div class="panel-content" id="app" v-cloak>
        <div class="panel-body panel-info">
            <el-tabs type="card">
                <el-tab-pane>
                    <span slot="label"><i class="fa fa-cog"></i>基础设置</span>
                    <el-form :model="formBase" class="form" ref="formBase" label-width="150px">
                        <div class="panel-header"><div class="panel-title">基本设置</div></div>
                        <div class="panel-main">
                            <el-form-item label="网站名称：" prop="site_name">
                                <el-input clearable v-model="formBase.site_name" placeholder="网站名称"></el-input>
                            </el-form-item>
                            <el-form-item label="网站LOGO：" prop="site_logo">
                                <el-upload
                                        :action="upload_image"
                                        :show-file-list="false"
                                        name="image"
                                        :limit="1"
                                        :on-success="uploadSiteLogoSuccess"
                                        :before-upload="uploadBefore" ref="upload1">
                                    <img v-if="formBase.site_logo" :src="formBase.site_logo" class="img-uploader site_logo-img">
                                    <i v-else class="el-icon-plus site_logo-uploader-icon"></i>
                                    <div slot="tip" class="el-upload__tip">图片大小不能超过 2MB，建议尺寸3:2!</div>
                                </el-upload>
                            </el-form-item>
                            {{--<el-form-item label="手机端LOGO：" prop="wap_logo">--}}
                                {{--<el-upload--}}
                                        {{--:action="upload_image"--}}
                                        {{--:show-file-list="false"--}}
                                        {{--name="image"--}}
                                        {{--:limit="1"--}}
                                        {{--:on-success="uploadWapLogoSuccess"--}}
                                        {{--:before-upload="uploadBefore" ref="upload2">--}}
                                    {{--<img v-if="formBase.wap_logo" :src="formBase.wap_logo" class="img-uploader wap_logo-img">--}}
                                    {{--<i v-else class="el-icon-plus wap_logo-uploader-icon"></i>--}}
                                    {{--<div slot="tip" class="el-upload__tip">图片大小不能超过 2MB，建议尺寸3:2!</div>--}}
                                {{--</el-upload>--}}
                            {{--</el-form-item>--}}
                            <el-form-item label="公众号二维码：" prop="public_code">
                                <el-upload
                                        :action="upload_image"
                                        :show-file-list="false"
                                        name="image"
                                        :limit="1"
                                        :on-success="uploadPublicCodeSuccess"
                                        :before-upload="uploadBefore" ref="upload3">
                                    <img v-if="formBase.public_code" :src="formBase.public_code" class="img-uploader public_code-img">
                                    <i v-else class="el-icon-plus public_code-uploader-icon"></i>
                                    <div slot="tip" class="el-upload__tip">图片大小不能超过 2MB，建议尺寸3:2!</div>
                                </el-upload>
                            </el-form-item>
                            <el-form-item label="用户默认头像：" prop="default_avatar">
                                <el-upload
                                        :action="upload_image"
                                        :show-file-list="false"
                                        name="image"
                                        :limit="1"
                                        :on-success="uploadDefaultAvatarSuccess"
                                        :before-upload="uploadBefore" ref="upload4">
                                    <img v-if="formBase.default_avatar" :src="formBase.default_avatar" class="img-uploader default_avatar-img">
                                    <i v-else class="el-icon-plus default_avatar-uploader-icon"></i>
                                    <div slot="tip" class="el-upload__tip">图片大小不能超过 2MB，建议尺寸3:2!</div>
                                </el-upload>
                            </el-form-item>
                            <el-form-item label="PC端登录注册页面背景图：" prop="login_logo">
                                <el-upload
                                        :action="upload_image"
                                        :show-file-list="false"
                                        name="image"
                                        :limit="1"
                                        :on-success="uploadLoginLogoSuccess"
                                        :before-upload="uploadBefore" ref="upload5">
                                    <img v-if="formBase.login_logo" :src="formBase.login_logo" class="img-uploader login_logo-img">
                                    <i v-else class="el-icon-plus login_logo-uploader-icon"></i>
                                    <div slot="tip" class="el-upload__tip">图片大小不能超过 2MB，建议尺寸1920*968!</div>
                                </el-upload>
                            </el-form-item>
                        </div>
                        <div class="panel-header"><div class="panel-title">备案设置</div></div>
                        <div class="panel-main">
                            <el-form-item label="版权信息：" prop="copyright">
                            <el-input clearable v-model="formBase.copyright" placeholder="版权信息"></el-input>
                            </el-form-item>
                            <el-form-item label="备案号：" prop="record_number">
                                <el-input clearable v-model="formBase.record_number" placeholder="备案号"></el-input>
                            </el-form-item>
                            <el-form-item label="备案链接：" prop="record_link">
                                <el-input clearable v-model="formBase.record_link" placeholder="备案链接"></el-input>
                            </el-form-item>
                            <el-form-item label="认证图片：" prop="authenticate">
                                <el-upload name="image" list-type="picture-card" multiple
                                           :action="upload_image"
                                           :on-success="uploadAuthSuccess"
                                           :before-upload="uploadBefore"
                                           :on-preview="handlePictureCardPreview"
                                           :on-remove="handleRemove"
                                           :file-list="img_arr">
                                    <i class="el-icon-plus"></i>
                                    <i v-else class="el-icon-plus authenticate-uploader-icon"></i>
                                    <div slot="tip" class="el-upload__tip">图片大小不能超过 2MB，建议尺寸128*45!</div>
                                </el-upload>
                                <el-dialog :visible.sync="dialogVisible"><img width="100%" :src="dialogImageUrl" alt=""></el-dialog>
                            </el-form-item>
                            {{--<el-form-item label="统计代码：" prop="stats_code">--}}
                            {{--<el-input type="textarea" rows="5" v-model="formBase.stats_code" placeholder="统计代码"></el-input>--}}
                            {{--</el-form-item>--}}
                            {{--<el-form-item label="公安备案号：" prop="public_record_number">--}}
                            {{--<el-input clearable v-model="formBase.public_record_number" placeholder="公安备案号"></el-input>--}}
                            {{--</el-form-item>--}}
                            {{--<el-form-item label="公安备案链接：" prop="public_record_link">--}}
                            {{--<el-input clearable v-model="formBase.public_record_link" placeholder="公安备案链接"></el-input>--}}
                            {{--</el-form-item>--}}
                        </div>
                        <div class="panel-header"><div class="panel-title">其他设置</div></div>
                        <div class="panel-main">
                            <el-form-item label="平台客服电话：" prop="customer_mobile">
                                <el-input clearable v-model="formBase.customer_mobile" placeholder="平台电话"></el-input>
                            </el-form-item>
                            <el-form-item label="平台客服QQ：" prop="customer_qq">
                                <el-input clearable v-model="formBase.customer_qq" placeholder="平台客服QQ"></el-input>
                            </el-form-item>
                            <el-form-item label="用户注册协议：" prop="register_agreement">
                                <div id="editor"></div>
                            </el-form-item>
                        </div>
                        <el-form-item style="padding-left: 150px;margin-top: 50px">
                            <el-button type="primary" @click="update('formBase')">保存提交</el-button>
                        </el-form-item>
                    </el-form>
                </el-tab-pane>
                <el-tab-pane>
                    <span slot="label"><i class="fa fa-gift"></i> 积分设置</span>
                    <el-form :model="formIntegral" class="form" ref="formIntegral" label-width="150px">
                        <div class="panel-header"><div class="panel-title">HR积分设置</div></div>
                        <div class="panel-main">
                            <el-form-item label="HR新用户注册：" prop="hr_register">
                                <el-input clearable v-model="formIntegral.hr_register" placeholder="HR新用户注册送积分"></el-input>
                            </el-form-item>
                            <el-form-item label="HR每日首次登录：" prop="hr_login">
                                <el-input clearable v-model="formIntegral.hr_login" placeholder="HR每日首次登录赠送积分"></el-input>
                            </el-form-item>
                            <el-form-item label="HR每日签到：" prop="hr_sign_in">
                                <el-input clearable v-model="formIntegral.hr_sign_in" placeholder="HR每日签到赠送积分"></el-input>
                            </el-form-item>
                            <el-form-item label="HR拨打电话：" prop="hr_call">
                                <el-input clearable v-model="formIntegral.hr_call" placeholder="HR拨打电话赠送积分"></el-input>
                            </el-form-item>
                            <el-form-item label="HR发布需求：" prop="hr_demand">
                                <el-input clearable v-model="formIntegral.hr_demand" placeholder="HR发布需求赠送积分"></el-input>
                            </el-form-item>
                            <el-form-item label="HR参加/购买活动：" prop="hr_activity">
                                <el-input clearable v-model="formIntegral.hr_activity" placeholder="HR参加/购买活动赠送积分"></el-input>
                            </el-form-item>
                            <el-form-item label="HR购买商品：" prop="hr_goods">
                                <el-input clearable v-model="formIntegral.hr_goods" placeholder="HR购买商品赠送积分"></el-input>
                            </el-form-item>
                        </div>
                        <div class="panel-header"><div class="panel-title">供应商积分设置</div></div>
                        <div class="panel-main">
                            <el-form-item label="商户新用户注册：" prop="bus_register">
                                <el-input clearable v-model="formIntegral.bus_register" placeholder="供应商新用户注册送积分"></el-input>
                            </el-form-item>
                            <el-form-item label="商户每日首次登录：" prop="bus_login">
                                <el-input clearable v-model="formIntegral.bus_login" placeholder="供应商每日首次登录赠送积分"></el-input>
                            </el-form-item>
                            <el-form-item label="商户每日签到：" prop="bus_sign_in">
                                <el-input clearable v-model="formIntegral.bus_sign_in" placeholder="供应商每日签到赠送积分"></el-input>
                            </el-form-item>
                            <el-form-item label="商户佣金：" prop="bus_commission">
                                <el-input clearable v-model="formIntegral.bus_commission" placeholder="供应商佣金赠送积分"></el-input>
                            </el-form-item>
                        </div>
                        <el-form-item style="padding-left: 150px;margin-top: 50px">
                            <el-button type="primary" @click="update('formIntegral')">保存</el-button>
                        </el-form-item>
                    </el-form>
                </el-tab-pane>
                <el-tab-pane>
                    <span slot="label"><i class="fa fa-gift"></i> 其他设置</span>
                    <el-form :model="formIntegral" class="form" ref="formIntegral" label-width="150px">
                        <div class="panel-main">
                            <el-form-item label="来电扣费：" prop="call_balance">
                                <el-input clearable v-model="formBase.call_balance" placeholder="HR拨打电话扣除余额"></el-input>
                            </el-form-item>
                            <el-form-item label="会员费有效期(天)：" prop="member_fee">
                                <el-input clearable v-model="formBase.member_fee" placeholder="会员费有效期(天)"></el-input>
                            </el-form-item>
                            <el-form-item label="需求商户上限：" prop="limit_demand">
                                <el-input clearable v-model="formBase.limit_demand" placeholder="HR发布需求商户上限"></el-input>
                            </el-form-item>
                            <el-form-item label="需求款项支付截止时间(天)：" prop="day_demand">
                                <el-input clearable v-model="formBase.day_demand" placeholder="需求款项支付截止时间"></el-input>
                            </el-form-item>
                            <el-form-item label="来电佣金(%)：" prop="call_money">
                                <el-input clearable v-model="formBase.call_money" placeholder="需求服务费比例-来电佣金"></el-input>
                            </el-form-item>
                            <el-form-item label="投标佣金(%)：" prop="bid_money">
                                <el-input clearable v-model="formBase.bid_money" placeholder="需求服务费比例-投标佣金"></el-input>
                            </el-form-item>
                        </div>
                        <el-form-item style="padding-left: 150px;margin-top: 50px">
                            <el-button type="primary" @click="update('formBase')">保存</el-button>
                        </el-form-item>
                    </el-form>
                </el-tab-pane>
                {{--<el-tab-pane>--}}
                    {{--<span slot="label"><i class="fa fa-server"></i> 三方服务</span>--}}
                    {{--<el-form :model="formService" class="form" ref="formService" label-width="100px">--}}
                        {{--<div class="panel-header"><div class="panel-title">QQ第三方登录</div></div>--}}
                        {{--<div class="panel-main">--}}
                            {{--<el-form-item label="ClientId：" prop="qq_key">--}}
                                {{--<el-input clearable v-model="formService.qq_key" placeholder="QQ CLIENT_ID"></el-input>--}}
                            {{--</el-form-item>--}}
                            {{--<el-form-item label="ClientSecret：" prop="qq_secret">--}}
                                {{--<el-input clearable v-model="formService.qq_secret" placeholder="QQ CLIENT_SECRET "></el-input>--}}
                            {{--</el-form-item>--}}
                            {{--<el-form-item label="RedirectUrl：" prop="qq_redirect_url">--}}
                                {{--<el-input clearable v-model="formService.qq_redirect_url" placeholder="QQ REDIRECT_UR"></el-input>--}}
                            {{--</el-form-item>--}}
                        {{--</div>--}}
                        {{--<div class="panel-header"><div class="panel-title">微信第三方登录</div></div>--}}
                        {{--<div class="panel-main">--}}
                            {{--<el-form-item label="ClientId：" prop="weixin_key">--}}
                                {{--<el-input clearable v-model="formService.weixin_key" placeholder="微信CLIENT_ID"></el-input>--}}
                            {{--</el-form-item>--}}
                            {{--<el-form-item label="ClientSecret：" prop="weixin_secret">--}}
                                {{--<el-input clearable v-model="formService.weixin_secret" placeholder="微信CLIENT_SECRET"></el-input>--}}
                            {{--</el-form-item>--}}
                            {{--<el-form-item label="RedirectUrl：" prop="weixin_redirect_url">--}}
                                {{--<el-input clearable v-model="formService.weixin_redirect_url" placeholder="微信REDIRECT_UR"></el-input>--}}
                            {{--</el-form-item>--}}
                        {{--</div>--}}
                        {{--<div class="panel-header"><div class="panel-title">阿里云短信</div></div>--}}
                        {{--<div class="panel-main">--}}
                            {{--<el-form-item label="KeyId：" prop="aliyun_sms_ak">--}}
                                {{--<el-input clearable v-model="formService.aliyun_sms_ak" placeholder="阿里短信服务AccessKeyId"></el-input>--}}
                            {{--</el-form-item>--}}
                            {{--<el-form-item label="KeySecret：" prop="aliyun_sms_as">--}}
                                {{--<el-input clearable v-model="formService.aliyun_sms_as" placeholder="阿里短信服务AccessKeySecret"></el-input>--}}
                            {{--</el-form-item>--}}
                            {{--<el-form-item label="SignName：" prop="aliyun_sms_sign_name">--}}
                                {{--<el-input clearable v-model="formService.aliyun_sms_sign_name" placeholder="阿里云短信服务签名"></el-input>--}}
                            {{--</el-form-item>--}}
                        {{--</div>--}}
                        {{--<div class="panel-header"><div class="panel-title">公众号</div></div>--}}
                        {{--<div class="panel-main">--}}
                            {{--<el-form-item label="AppId：" prop="wechat_app_id">--}}
                                {{--<el-input clearable v-model="formService.wechat_app_id" placeholder="公众号AppId"></el-input>--}}
                            {{--</el-form-item>--}}
                            {{--<el-form-item label="AppSecret：" prop="wechat_app_secret">--}}
                                {{--<el-input clearable v-model="formService.wechat_app_secret" placeholder="公众号AppSecret"></el-input>--}}
                            {{--</el-form-item>--}}
                            {{--<el-form-item label="Token：" prop="wechat_app_token">--}}
                                {{--<el-input clearable v-model="formService.wechat_app_token" placeholder="公众号Token"></el-input>--}}
                            {{--</el-form-item>--}}
                            {{--<el-form-item label="AesKey：" prop="wechat_app_aeskey">--}}
                                {{--<el-input clearable v-model="formService.wechat_app_aeskey" placeholder="公众号AesKey"></el-input>--}}
                            {{--</el-form-item>--}}
                        {{--</div>--}}
                        {{--<div class="panel-header"><div class="panel-title">小程序</div></div>--}}
                        {{--<div class="panel-main">--}}
                            {{--<el-form-item label="AppId：" prop="mini_app_id">--}}
                                {{--<el-input clearable v-model="formService.mini_app_id" placeholder="小程序AppId"></el-input>--}}
                            {{--</el-form-item>--}}
                            {{--<el-form-item label="AppSecret：" prop="mini_app_token">--}}
                                {{--<el-input clearable v-model="formService.mini_app_secret" placeholder="小程序AppSecret"></el-input>--}}
                            {{--</el-form-item>--}}
                            {{--<el-form-item label="Token：" prop="mini_app_token">--}}
                                {{--<el-input clearable v-model="formService.mini_app_token" placeholder="小程序Token"></el-input>--}}
                            {{--</el-form-item>--}}
                            {{--<el-form-item label="AesKey：" prop="mini_app_aeskey">--}}
                                {{--<el-input clearable v-model="formService.mini_app_aeskey" placeholder="小程序AesKey"></el-input>--}}
                            {{--</el-form-item>--}}
                        {{--</div>--}}
                        {{--<el-form-item style="padding-left: 150px;margin-top: 50px">--}}
                            {{--<el-button type="primary" @click="update('formService')">保存提交</el-button>--}}
                        {{--</el-form-item>--}}
                    {{--</el-form>--}}
                {{--</el-tab-pane>--}}
            </el-tabs>
        </div>
    </div>
@endsection
@section('scripts')
    <script src="{{ asset('neditor/neditor.config.js') }}" type="text/javascript"></script>
    <script src="{{ asset('neditor/neditor.all.min.js') }}" type="text/javascript"></script>
    <script src="{{ asset('neditor/neditor.service.js') }}" type="text/javascript"></script>
    <script src="{{ asset('neditor/i18n/zh-cn/zh-cn.js') }}" type="text/javascript"></script>
    <script src="{{ asset('neditor/third-party/browser-md5-file.min.js') }}" type="text/javascript"></script>
    <script src="{{ asset('neditor/third-party/jquery-1.10.2.min.js') }}" type="text/javascript"></script>
    <script>
        let app = new Vue({
            el: '#app',
            data: function() {
                return {
                    dialogImageUrl: '',
                    dialogVisible: false,
                    upload_image: UPLOAD_IMAGE,
                    bases: {!! $base !!},
                    integrals: {!! $integral !!},
                    services: {!! $service !!},
                    formBase: null,
                    formIntegral: null,
                    formService: null,
                    editor: null,
                    img_arr: [],//认证图片
                }
            },
            created(){
                this.editor = UE.getEditor('editor');
                let that = this;
                this.formBase = {
                    type: 'base',
                    site_name: this.bases.site_name,//网站名称
                    site_logo: this.bases.site_logo,//网站logo
                    // wap_logo: this.bases.wap_logo,//手机端logo
                    public_code: this.bases.public_code,//公众号二维码
                    default_avatar: this.bases.default_avatar,//默认用户头像
                    login_logo: this.bases.login_logo,//PC端登录注册页背景图
                    stats_code: this.bases.stats_code,//统计代码
                    copyright: this.bases.copyright,//版权信息
                    record_number: this.bases.record_number,//备案号
                    record_link: this.bases.record_link,//备案链接
                    public_record_number: this.bases.public_record_number,//公安备案号
                    public_record_link: this.bases.public_record_link,//公安备案链接
                    customer_mobile: this.bases.customer_mobile,//平台电话
                    customer_qq: this.bases.customer_qq,//平台客服QQ
                    call_balance: this.bases.call_balance,//拨打电话扣除余额
                    limit_demand: this.bases.limit_demand,//需求商户上限
                    day_demand: this.bases.day_demand,//需求款项支付截止时间
                    member_fee: this.bases.member_fee,//会员费有效期-供应商
                    call_money: this.bases.call_money,//需求服务费比例-来电佣金
                    bid_money: this.bases.bid_money,//需求服务费比例-投标佣金
                    register_agreement: this.bases.register_agreement,//用户注册协议
                    authenticate: this.bases.authenticate,//认证图片
                };
                this.formBase.authenticate.map(item=>{
                    this.img_arr.push({url:item})
                })
                this.editor.ready(function () {
                    that.editor.setContent(that.formBase.register_agreement);
                });
                this.formIntegral = {
                    type: 'integral',
                    hr_register: this.integrals.hr_register,//HR新用户注册
                    hr_login: this.integrals.hr_login,//HR每日首次登录
                    hr_sign_in: this.integrals.hr_sign_in,//HR每日签到
                    hr_call: this.integrals.hr_call,//HR拨打电话
                    hr_demand: this.integrals.hr_demand,//HR发布需求
                    hr_activity: this.integrals.hr_activity,//HR参加/购买活动
                    hr_goods: this.integrals.hr_goods,//HR购买商品
                    bus_register: this.integrals.bus_register,//商户新用户注册
                    bus_login: this.integrals.bus_login,//商户每日首次登录
                    bus_sign_in: this.integrals.bus_sign_in,//商户每日签到
                    bus_recharge: this.integrals.bus_recharge,//供商户充值
                    bus_commission: this.integrals.bus_commission,//商户佣金
                };
                this.formService = {
                    type: 'service',
                    //QQ第三方登录
                    qq_key: this.services.qq_key,
                    qq_secret: this.services.qq_secret,
                    qq_redirect_url: this.services.qq_redirect_url,
                    //微信第三方登录
                    weixin_key: this.services.weixin_key,
                    weixin_secret: this.services.weixin_secret,
                    weixin_redirect_url: this.services.weixin_redirect_url,
                    //阿里云短信
                    aliyun_sms_ak: this.services.aliyun_sms_ak,
                    aliyun_sms_as: this.services.aliyun_sms_as,
                    aliyun_sms_sign_name: this.services.aliyun_sms_sign_name,
                    //公众号
                    wechat_app_id: this.services.wechat_app_id,
                    wechat_app_secret: this.services.wechat_app_secret,
                    wechat_app_token: this.services.wechat_app_token,
                    wechat_app_aeskey: this.services.wechat_app_aeskey,
                    //小程序
                    mini_app_id: this.services.mini_app_id,
                    mini_app_token: this.services.mini_app_token,
                    mini_app_token: this.services.mini_app_token,
                    mini_app_aeskey: this.services.mini_app_aeskey,
                };
            },
            methods: {
                uploadSiteLogoSuccess(res) {
                    this.formBase.site_logo = res.data.path;
                    this.$refs.upload1.clearFiles(); //上传成功之后清除历史记录
                },
                // uploadWapLogoSuccess(res){
                //     this.formBase.wap_logo = res.data.path;
                //     this.$refs.upload2.clearFiles(); //上传成功之后清除历史记录
                // },
                uploadPublicCodeSuccess(res){
                    this.formBase.public_code = res.data.path;
                    this.$refs.upload3.clearFiles(); //上传成功之后清除历史记录
                },
                uploadDefaultAvatarSuccess(res){
                    this.formBase.default_avatar = res.data.path;
                    this.$refs.upload4.clearFiles(); //上传成功之后清除历史记录
                },
                uploadLoginLogoSuccess(res){
                    this.formBase.login_logo = res.data.path;
                    this.$refs.upload5.clearFiles(); //上传成功之后清除历史记录
                },
                uploadAuthSuccess(res){
                    this.formBase.authenticate.push(res.data.path);
                },
                uploadBefore(file) {
                    const isLt2M = file.size / 1024 / 1024 < 2;
                    if (!isLt2M) {
                        this.$message.error('图片大小不能超过 2MB!');
                    }
                    return isLt2M;
                },
                //移除
                handleRemove(file, fileList) {
                    this.formBase.authenticate.indexOf(file.url) !=-1? this.formBase.authenticate.splice(this.formBase.authenticate.indexOf(file.url),1) : '';
                },
                //放大
                handlePictureCardPreview(file) {
                    this.dialogImageUrl = file.url;
                    this.dialogVisible = true;
                },
                //更新
                update(name){
                    console.log(this.formBase.authenticate);
                    this.formBase.register_agreement = this.editor.getContent();
                    let that = this,formData;
                    switch (name) {
                        case 'formBase':
                            formData = this.formBase;
                            break;
                        case 'formIntegral':
                            formData = this.formIntegral;
                            break;
                        case 'formService':
                            formData = this.formService;
                            break;
                    }
                    formData._token = "{{csrf_token()}}";
                    $.post("{{ route('admin.config.update') }}",formData,function (res) {
                        if(res.code){
                            that.$message.error(res.msg);
                        }else{
                            that.$message({
                                type: 'success',
                                duration: '1000',
                                message: res.msg,
                            });
                        }
                    },'JSON');
                },
            }
        });
    </script>
@endsection
